#include <iostream>

using namespace std;

class Solution
{
public:
    int numberOfWays(string corridor)
    {
        unsigned long long ans = 1;
        int plantCount = 0;
        int chairCount = 0;
        int totalChairs = 0;
        for (auto c : corridor)
        {
            if (c == 'S')
            {
                chairCount++;
                totalChairs++;
                if (chairCount == 3)
                {
                    ans = (ans * (plantCount + 1)) % 1000000007;
                    chairCount = 1;
                }
            }
            else
            {
                if (chairCount == 2)
                    plantCount++;
            }
        }
        if (totalChairs % 2 != 0 || totalChairs == 0)
            ans = 0;
        return ans;
    }
};

int main()
{
    cout << "Code2147" << endl;
    Solution s;
    return 0;
}